package com.ogilvy.audi.model;

import org.apache.struts2.json.annotations.JSON;
import org.hibernate.Criteria;
import org.hibernate.annotations.ForeignKey;

import javax.persistence.*;
import java.util.Date;

/**
 * TblCircleBulletin entity. @author MyEclipse Persistence Tools
 */
@Entity
   @Table(name="TBL_CIRCLE_BULLETIN")
   @org.hibernate.annotations.Table(appliesTo = "TBL_CIRCLE_BULLETIN", comment = " 圈子公告表 ")

public class CircleBulletin extends  BaseObject implements java.io.Serializable {

	// Fields

	private Long bulletinId;
	private String title;
	private String descn;
	private Long bullorder;

	private Date crDate;
    private Integer version;

  // private CircleCategory circleCategory;
	// Constructors

	/** default constructor */
	public CircleBulletin() {
	}

	/** full constructor */
	public CircleBulletin(String title, String descn, Long bullorder,
                          Date crDate) {
		this.title = title;
		this.descn = descn;
		this.bullorder = bullorder;

		this.crDate = crDate;
	}

	// Property accessors
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
	public Long getBulletinId() {
		return this.bulletinId;
	}

	public void setBulletinId(Long bulletinId) {
		this.bulletinId = bulletinId;
	}
   @Column(length = 200)
	public String getTitle() {
		return this.title;
	}

	public void setTitle(String title) {
		this.title = title;
	}
   @Column(length = 300)
	public String getDescn() {
		return this.descn;
	}

	public void setDescn(String descn) {
		this.descn = descn;
	}
  @Column()
	public Long getBullorder() {
		return this.bullorder;
	}

	public void setBullorder(Long bullorder) {
		this.bullorder = bullorder;
	}


    @Column(length =8)
	@Temporal(value= TemporalType.TIMESTAMP)
    public Date getCrDate() {
        return crDate;
    }

    public void setCrDate(Date crDate) {
        this.crDate = crDate;
    }

        @Version
    public Integer getVersion() {
        return version;
    }

    public void setVersion(Integer version) {
        this.version = version;
    }
/* @ManyToOne(targetEntity= CircleCategory.class,fetch = FetchType.LAZY,cascade={CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REFRESH})
    @JoinColumn(name="CIRCLE_ID",nullable=true)
    @ForeignKey(name="FK_BULLETIN_CIRCLE_ID")
    @JSON(serialize=false)
    public CircleCategory getCircleCategory() {
        return circleCategory;
    }

    public void setCircleCategory(CircleCategory circleCategory) {
        this.circleCategory = circleCategory;
    }*/

    @Override
    public String toString() {
        return null;  //To change body of implemented methods use File | Settings | File Templates.
    }

    @Override
    public boolean equals(Object o) {
        return false;  //To change body of implemented methods use File | Settings | File Templates.
    }

    @Override
    public int hashCode() {
        return 0;  //To change body of implemented methods use File | Settings | File Templates.
    }
}